package com.api.shopapi.service.impl;

import com.api.shopapi.entity.ElderlyCheckinAssessWait;
import com.api.shopapi.entity.dto.ElderlyClassDTO;
import com.api.shopapi.mapper.ElderlyCheckinAssessWaitMapper;
import com.api.shopapi.service.ElderlyCheckinAssessWaitService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("ElderlyCheckinAssessWaitServiceImplOne")
public class ElderlyCheckinAssessWaitServiceImplOne implements ElderlyCheckinAssessWaitService {

    @Autowired
    private ElderlyCheckinAssessWaitMapper elderlyCheckinAssessWaitMapper;

    @Override
    public
    int insert(ElderlyCheckinAssessWait elderlyCheckinAssessWait){
        return elderlyCheckinAssessWaitMapper.insert(elderlyCheckinAssessWait);
    }

    @Override
    public
    int delete(String elderlyCheckinAssessWaitCode){
        return elderlyCheckinAssessWaitMapper.delete(elderlyCheckinAssessWaitCode);
    }

    @Override
    public
    int update(ElderlyCheckinAssessWait elderlyCheckinAssessWait){
        return elderlyCheckinAssessWaitMapper.update(elderlyCheckinAssessWait);
    }

    @Override
    public
    ElderlyCheckinAssessWait getByCode(String elderlyCheckinAssessWaitCode){
        return elderlyCheckinAssessWaitMapper.getByCode(elderlyCheckinAssessWaitCode);
    }

    @Override
    public
    List<ElderlyCheckinAssessWait> listByInstitutionCode(String institutionCode){
        return elderlyCheckinAssessWaitMapper.listByInstitutionCode(institutionCode);
    }

    @Override
    public
    List<ElderlyCheckinAssessWait> listByGovCode(String governmentCode){
        return elderlyCheckinAssessWaitMapper.listByGovCode(governmentCode);
    }

    @Override
    public
    PageInfo<ElderlyCheckinAssessWait> pageByInsCode(int pageIndex, int pageSize, String institutionCode){
        PageHelper.startPage(pageIndex,pageSize);
        List<ElderlyCheckinAssessWait> elderlyClassList =elderlyCheckinAssessWaitMapper.listByInstitutionCode(institutionCode);
        return new PageInfo<>(elderlyClassList);
    }

    @Override
    public
    PageInfo<ElderlyCheckinAssessWait> pageByGovCode(int pageIndex, int pageSize,String governmentCode){
        PageHelper.startPage(pageIndex,pageSize);
        List<ElderlyCheckinAssessWait> elderlyClassList =elderlyCheckinAssessWaitMapper.listByGovCode(governmentCode);
        return new PageInfo<>(elderlyClassList);
    }

    @Override
    public
    List<ElderlyCheckinAssessWait> listByElderlyCode(String elderlyCode){
        return elderlyCheckinAssessWaitMapper.listByElderlyCode(elderlyCode);
    }


}
